package dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ResourceBundle;

public class ConnectionOracle {

	private static Connection connect;
	
	public Connection getInstance(){
		
		if (connect == null){
			try{
			System.out.println("putain de merde");
			ResourceBundle bundle = ResourceBundle.getBundle("config");
			DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
			System.out.println("guiiiii");
			connect = DriverManager.getConnection (bundle.getString("url"), bundle.getString("user"), bundle.getString("password"));
		
			} 
			catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return connect;
	}
}
